<?php
if (!isset($sp))
    $sp = explode("/", $_SERVER['PHP_SELF']);

if ($_SERVER['HTTP_HOST'] == "localhost" || $_SERVER['HTTP_HOST'] == "192.168.1.25") {
    $sp[1] = '/' . $sp[1];
}
else
    $sp[1] = '';

$w_root = $_SERVER['SERVER_NAME'] . $sp[1];
$w_root = str_replace('//', '/', $w_root);
$w_root = str_replace('\\\\', '\\', $w_root);

$s_root = $_SERVER['DOCUMENT_ROOT'] . $sp[1];
$s_root = str_replace('//', '/', $s_root);
$s_root = str_replace('\\\\', '\\', $s_root);
/* ========End Setting up web root and server root ============= */

require_once $s_root . '/libraryfiles/config.php'; //
require_once $s_root . '/libraryfiles/cart-functions.php';
?>
<!DOCTYPE html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title><?php echo $site_title;?></title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta name="description" content="<?php echo $site_description; ?>" />
        <meta name="keywords" content="<?php echo $site_keywords; ?>" />
        <base href="<?php echo base_url; ?>" />
        <link rel="stylesheet" href="<?php echo base_url; ?>templates/stylesheet/bootstrap.css" />
        <link rel="stylesheet" href="<?php echo base_url; ?>templates/stylesheet/stylesheet.css" />
        <link rel="stylesheet" href="<?php echo base_url; ?>templates/stylesheet/bootstrap-responsive.min.css" />
        <link rel="stylesheet" href="<?php echo base_url; ?>templates/stylesheet/theme-responsive.css" />
        <link rel="stylesheet" href="<?php echo base_url; ?>templates/stylesheets/app.css" />
        <link href='http://fonts.googleapis.com/css?family=Hanuman' rel='stylesheet' type='text/css'/>
        <script src="<?php echo base_url; ?>templates/javascripts/jquery-1.7.1.min.js"></script>

        <link rel="stylesheet" href="<?php echo base_url; ?>feature/coin-slider/coin-slider-styles.css" type="text/css" />
        <script src="<?php echo base_url; ?>templates/javascripts/bootstrap-alert.js"></script>
        <link media="screen" rel="stylesheet" href="<?php echo W_ROOT; ?>/social/login/widget/css/colorbox.css" />
        <script src="<?php echo base_url; ?>social/login/widget/js/jquery.colorbox.js"></script>
        <script type="text/javascript" src="<?php echo base_url; ?>templates/javascripts/bootstrap.min.js"></script>
        <script>
            $(document).ready(function() {
                $(".widget_link").colorbox({iframe: true, innerWidth: 430, innerHeight: 222});
                $(".cart_popup").colorbox();
            });
        </script>
        <?php
        if (isset($include)) {
            echo $include;
        }
        /* Add Javascript and CSS files */
        ?>
        <!-- IE Fix for HTML5 Tags -->
        <!--[if lt IE 9]>
          <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
    </head>
    <body>
        <section id="page-container">
            <?php include(S_ROOT . '/templates/header.php'); ?>
            <section id="columns">
                <div class="container">
                    <?php //include(S_ROOT . '/includefiles/breadcrumbs.php'); ?>
                    <div class="<?php if ($pageURL == $homepage) { ?>home_page<?php
                    } else {
                        echo 'not_home';
                    }
                    ?>">
                        <?php
                        if (!isset($content))
                            $content = basename($_SERVER['PHP_SELF']);
                        require ($content);
                        ?>
                        <?php
                        if ($pageURL == $homepage) {
                            ?>
                       <?php
                        }
                        ?>
                    </div><!--End Home page -->
                </div>
                </div>
                <?php include(S_ROOT . '/templates/footer.php'); ?>
                <?php
                if (isset($_GET['updatesuccess']) == 1) {
                    ?>
                    <script type="text/javascript">
                        alert("Update Success!");
                    </script>
                    <?php
                }
                ?>
                <?php exit; ?>